<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:constants="http://www.tuanzi.com/constants/tags"
                template="/templates/template.xhtml">
    <ui:define name="title">甲方标签库 - 导入更新</ui:define>
    <ui:define name="content">
        <h:form>
            <div class="ui-fluid" style="padding-top: 30px;">
                <div class="ui-g">
                    <div class="ui-g-12">
                        <div class="card">
                            <h1>文件导入</h1>
                            <p:fileUpload fileUploadListener="#{firstPartyTagImportBean.onUpload}"
                                          mode="advanced"
                                          dragDropSupport="false"
                                          multiple="true" sizeLimit="100000" fileLimit="3"
                                          allowTypes="/(\.|\/)(xls|xlsx)$/" uploadLabel="上传" cancelLabel="取消"
                                          label="选择" styleClass="showUploadFile" update="@form"/>
                        </div>
                        <div class="card">
                            <h1>当天更新产品列表</h1>
                            <p:dataTable id="importProductDataTable"
                                         style="width: 100%"
                                         var="productInfoUpload"
                                         value="#{firstPartyTagImportBean.productInfoUploads}"
                                         rows="#{constants:get('ROWS')}"
                                         paginator="true"
                                         paginatorTemplate="#{constants:get('PAGINATOR_TEMPLATE')}"
                                         rowsPerPageTemplate="#{constants:get('ROWS_PER_PAGE_TEMPLATE')}"
                                         emptyMessage="#{constants:get('EMPTY_MESSAGE')}"
                                         scrollable="true"
                                         scrollWidth="97%"
                                         reflow="true"
                                         resizableColumns="true">

                                <p:column headerText="ID">
                                    <h:outputText value="#{productInfoUpload.productInfoId}"/>
                                </p:column>
                                <p:column headerText="甲方名称">
                                    <h:outputText value="#{productInfoUpload.productName}"/>
                                </p:column>
                                <p:column headerText="甲方icon">
                                    <p:graphicImage url="#{productInfoUpload.logo}" width="50px"/>
                                </p:column>
                                <p:column headerText="控量数">
                                    <h:outputText
                                            value="#{productInfoUpload.dailyClickUvLimitation == null ?'否': productInfoUpload.dailyClickUvLimitation}"/>
                                </p:column>
                                <p:column headerText="自动上线">
                                    <h:outputText style="font-weight: bold; color: red" value="否"
                                                  rendered="#{!productInfoUpload.autoOnline}"/>
                                    <h:outputText style="font-weight: bold; color: green" value="是"
                                                  rendered="#{productInfoUpload.autoOnline}"/>
                                </p:column>
                                <p:column headerText="自动上线时间">
                                    <h:outputText value="#{productInfoUpload.productAutoOnlineTimeDisplay}">
                                        <f:convertDateTime pattern="HH:mm"/>
                                    </h:outputText>
                                </p:column>
                            </p:dataTable>
                        </div>
                    </div>
                </div>
            </div>
        </h:form>
    </ui:define>
</ui:composition>
